<!--
  description: Home
  @author: GuoSiYue
  date: 2021-11-10
 -->

<template>
    <div>
        <!-- 在vue2中比较推荐使用Mixin，而在vue3中推荐使用Composition API -->
    </div>
</template>

<script>
    import sayHelloMixin from './sayHelloMixin'
    export default {
        name: "Home",
        mixins: [sayHelloMixin],
        data() {
            return {
                message: 'Hello World',
            //    冲突时，会保留组件中的属性（name）
                name: 'home'
            }
        },
        created() {
            console.log('home created');
            this.bar()
        },
        methods: {
            foo() {
                console.log('mixin foo function');
            },
            bar() {
                console.log('bar function');
            }
        }
    }
</script>

<style scoped>

</style>